package com.paw.oauth2.chase.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lvzihai
 * @date 2021/7/14
 **/
@RestController
public class ChaseController {

  @GetMapping("/chase")
  public String chase(){

    return "chase";
  }

  @PreAuthorize("hasAnyRole('ROLE_USER')")
  @GetMapping("/roleUser")
  public String getRoleUser(){
    return "roleUser";
  }
}
